#!/bin/bash
####################################################################
# Prey Webcam Module - by Tomas Pollak (bootlog.org)
# URL : http://preyproject.com
# License: GPLv3
####################################################################

log "$STRING_TAKE_PICTURE"
take_picture

if [ -f "$webcam__picture" ]; then
	add_file picture "$webcam__picture"
else
	log " !! Couldn't grab a picture! Please make sure your webcam is correctly configured."
fi

if [ $webcam__capture_video == 'y' ]; then

	log "$STRING_CAPTURE_VIDEO"
	capture_video

	if [ -f "$webcam__video" ]; then
		add_file video "$webcam__video"
	fi

fi
